{extend name="common@public:base"}

{block name="body"}
<body>
<!--项目详情-->

<div class="investcon" id="content">

	<div class="zt_butn cofebg">
		<div class="calcbnt"><img src="__static__/images/ymkj/calc2.png" /></div>

		<button type="button" class="mui-btn cofebg xmtzbnt" disabled="disabled">已还完</button>
		<button type="button" class="mui-btn cofebg xmtzbnt" disabled="disabled">还款中</button>
		<button type="button" class="mui-btn cofebg xmtzbnt " disabled="disabled">已满标</button>
		<button type="button" class="mui-btn cofebg xmtzbnt" id="confirmBtn">立即投资</button>
	</div>
	<div class="xmcontbox">
		<div class="xmc_head">
			<h1>16<span>%+0.5%</span></h1>
			<h2>预期年化利率</h2>
			<p class="qx">期限2个月&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;100元起投</p>
			<div class="xm_blbox">
				<p><span>99</span>%已售</p>
				<div class="xm_bl"></div>
			</div>
			<div class="xmye">
				<h3>剩余可投<span>4580.00</span>元</h3>
				<h4>项目总额<span>987450.00</span>元</h4>
			</div>
		</div>
		<div class="zcs">注册即送2999元红包+1%加息券</div>
		<ul class="xmcont">
			<li>
				<h1>项目名称</h1>
				<h2>小雨投资活动标NO20170629036</h2>
			</li>
			<li>
				<h1>还款方式</h1>
				<h2>到期还款，按月付息</h2>
			</li>
			<li class="bod0">
				<h1>计息方式</h1>
				<h2>满标复审计息</h2>
			</li>
		</ul>
		<ul class="xmcont">
			<li>
				<h1>债权列表</h1>
				<div class="cr">
					<h4></h4>
					<h3>共有34个债权</h3>
				</div>
			</li>
			<li class="bod0">
				<h1>投资记录</h1>
				<div class="cr">
					<h4></h4>
					<h3>已投资5人</h3>
				</div>
			</li>
		</ul>
	</div>
</div>


<div class="calc_box">
	<div class="calcbg" onclick="calc_c()"></div>

	<!--calc的rat为此标的利率 ，bi为此标的属性，y是月标，t是天标-->
	<div class="calc" rat="16.5" bi="y">
		<h1>收益计算</h1>
		<div class="cal">
			<input type="text" class="cal_je" placeholder="请输入投资金额(元)"/>
			<input type="text" class="cal_qx"  placeholder="请输入投资期限"/>
		</div>
		<h2><span>0.00</span>元</h2>
		<h3>预期收益</h3>
		<ul>
			<li class="cal_close" onclick="calc_c()">关闭</li>
			<li class="cal_js" onclick="calc()">计算</li>
		</ul>
	</div>
</div>

<script type="text/javascript">
	$(document).ready(function(){
		var winw=$(".xmye").width();
		var sell=$(".xm_blbox p span").text();
		var sel=parseInt(sell)/100*winw
		if(sel==0){
			$(".xm_blbox").hide()
		}else if(sel<=70&&sel>0){
			$(".xm_blbox p").css("text-align","left");
			$(".xm_blbox").css("width",70);
			$(".xm_bl").css("width",sel);
			alert(sel)
		}else{
			$(".xm_blbox").animate({"width":sel},1000)
		}

		var sx=$(".calc").attr("bi");
		if(sx=='y'){
			$(".cal_qx").attr("placeholder",'请输入投资期限(月)')
		}else if(sx=='t'){
			$(".cal_qx").attr("placeholder",'请输入投资期限(天)')
		}
	})


	$(".calcbnt").click(function(){
		$(".calc_box").show();
	})
	function calc_c(){
		$(".calc_box").hide()
	}

	function calc(){
		var rat=$(".calc").attr("rat");
		var qx=$(".cal_qx").val();
		var je=$(".cal_je").val();
		var sx=$(".calc").attr("bi");
		if(sx=='y'){
			var money=je*rat*qx/1200;
		}else if(sx=='t'){
			var money=je*rat*qx/36500;
		}
		$(".calc").find("h2 span").text(money)
	}
</script>
</body>
{/block}
